<!DOCTYPE html>
<html>

<head>
    <style>
        /* 基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: Arial;
        }

        body {
            background: #f5f5f5;
        }

        /* 导航栏 */
        .nav-bar {
            position: fixed;
            bottom: 0;
            width: 100%;
            display: flex;
            background: white;
            padding: 12px 0;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        }

        .nav-item {
            flex: 1;
            text-align: center;
            color: #666;
            font-size: 14px;
            cursor: pointer;
        }

        .nav-item.active {
            color: #1890ff;
        }

        /* 页面容器 */
        .page {
            padding: 20px;
            padding-bottom: 70px;
        }

        /* 模块通用样式 */
        .module {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 15px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        }

        /* 模块1：位置与安全状态 */
        .location-module {
            position: relative;
        }

        .safety-status {
            position: absolute;
            top: 10px;
            right: 10px;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: bold;
        }

        .status-safe {
            background: #e6ffed;
            color: #52c41a;
        }

        /* 绿色 */
        .status-alert {
            background: #fff1f0;
            color: #ff4d4f;
        }

        /* 红色 */
        .map-placeholder {
            height: 160px;
            background: #eee;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #666;
        }

        /* 模块2：健康指标卡片（2x2布局） */
        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-top: 10px;
        }

        .metric-card {
            padding: 12px;
            border-radius: 8px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .metric-card h4 {
            margin-bottom: 8px;
            font-size: 16px;
        }

        .metric-card .date {
            position: absolute;
            top: 8px;
            right: 8px;
            font-size: 12px;
            color: #999;
        }

        .metric-normal {
            background: #f6ffed;
            color: #52c41a;
        }

        /* 绿色 */
        .metric-warning {
            background: #fff2e8;
            color: #fa8c16;
        }

        /* 橙色 */
        .metric-danger {
            background: #fff1f0;
            color: #ff4d4f;
        }

        /* 红色 */
        .metric-value {
            font-size: 20px;
            font-weight: bold;
            margin: 8px 0;
        }

        .metric-icon {
            font-size: 24px;
            margin-bottom: 8px;
        }

        /* 模块3：用药提醒 */
        .medication-progress {
            font-size: 14px;
        }

        .progress-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid #eee;
        }

        .progress-item:last-child {
            border-bottom: none;
        }

        .progress-completed {
            color: #52c41a;
        }

        /* 绿色 */
        .progress-pending {
            color: #ff4d4f;
        }

        /* 红色 */

        /* 标题样式 */
        h3 {
            font-size: 24px;
            color: #333;
            margin-bottom: 16px;
        }

        /* 用药提醒标题样式 */
        .medication-title {
            font-size: 20px;
            color: #333;
            margin-bottom: 12px;
        }
    </style>
</head>

<body>
    <!-- 健康页 -->
    <div class="page" id="healthPage">
        <!-- 模块1：位置与安全状态 -->
        <div class="module location-module">
            <div class="safety-status status-safe">安全中</div>
            <div class="map-placeholder">地图标记（老人实时位置）</div>
        </div>

        <!-- 模块2：健康指标卡片 -->
        <div class="module">
            <h3>健康指标</h3>
            <div class="metrics-grid">
                <div class="metric-card metric-normal">
                    <div class="metric-icon">❤️</div>
                    <h4>心率</h4>
                    <div class="metric-value">78</div>
                    <div>次/分钟</div>
                    <div class="date">2021-11-20</div>
                </div>
                <div class="metric-card metric-danger">
                    <div class="metric-icon">🩸</div>
                    <h4>血氧</h4>
                    <div class="metric-value">88%</div>
                    <div>（低）</div>
                    <div class="date">2021-11-20</div>
                </div>
                <div class="metric-card metric-normal">
                    <div class="metric-icon">🌡️</div>
                    <h4>体温</h4>
                    <div class="metric-value">36.5</div>
                    <div>℃</div>
                    <div class="date">2021-11-20</div>
                </div>
                <div class="metric-card metric-warning">
                    <div class="metric-icon">💤</div>
                    <h4>睡眠</h4>
                    <div class="metric-value">3.2</div>
                    <div>小时</div>
                    <div class="date">2021-11-20</div>
                </div>
            </div>
        </div>

        <!-- 模块3：用药提醒 -->
        <div class="module">
            <div class="medication-title">今日用药进度（3/5）</div>
            <div class="medication-progress">
                <div class="progress-item">
                    <span>09:00 降压药</span>
                    <span class="progress-completed">✅ 已完成</span>
                </div>
                <div class="progress-item">
                    <span>12:00 维生素</span>
                    <span class="progress-completed">✅ 已完成</span>
                </div>
                <div class="progress-item">
                    <span>15:00 止痛药</span>
                    <span class="progress-pending">⏳ 未完成</span>
                </div>
                <div class="progress-item">
                    <span>18:00 降糖药</span>
                    <span class="progress-pending">⏳ 未完成</span>
                </div>
            </div>
        </div>
    </div>

    <!-- 底部导航栏（保持原有结构） -->
    <div class="nav-bar">
        <div class="nav-item active" onclick="showPage('healthPage')">健康</div>
        <div class="nav-item" onclick="showPage('safetyPage')">安全监控</div>
        <div class="nav-item" onclick="showPage('controlPage')">远程控制</div>
    </div>

    <script>
        // 保持原有的页面切换逻辑
        function showPage(pageId) {
            document.querySelectorAll('.page').forEach(page => {
                page.style.display = 'none';
            });
            document.getElementById(pageId).style.display = 'block';

            document.querySelectorAll('.nav-item').forEach(item => {
                item.classList.remove('active');
            });
            event.target.classList.add('active');
        }
    </script>
</body>

</html>